fix(memory): strip type field from entities/relations in loadGraph#3094
fix(memory): strip type field from entities/relations in loadGraph#3094jared03 wants to merge 2 commits intomodelcontextprotocol:mainfrom
Conversation
The JSONL file stores entities with a 'type' field to distinguish them from relations. However, the output schema for read operations doesn't include this field, causing schema validation errors (-32602). This fix uses destructuring to remove the 'type' field before pushing entities and relations to the result arrays. Fixes modelcontextprotocol#3074
|
你好 @jared03,感谢你修复这个问题!🙏 我正在 Cursor IDE 中使用 由于这个 PR 还未合并,修复还没有发布到 npm 包中,导致我无法在 Cursor 中正常使用 memory MCP 服务器。 问题:
感谢你的工作!期待使用修复后的版本。🚀 |
|
I'd love to see this make it in. My MCP calls are not working right now. |
|
似乎还需要有仓库权限的人审批。 |
|
I independently discovered this same bug and implemented the identical fix. Can confirm this is the correct solution. Root cause: The fix is correct: Destructuring to strip This also fixes #3144 which reports the same error. +1 for merge - this is blocking all read operations for anyone using the memory server. |
Summary
Fixes schema validation error in read operations (
read_graph,search_nodes,open_nodes).Problem
The JSONL file stores entities with a
typefield to distinguish them from relations:{"type":"entity","name":"...","entityType":"...","observations":[...]}But the output schema only expects
{name, entityType, observations}- notypefield.This causes all read operations to fail with:
Solution
Strip the
typefield using destructuring before pushing to result arrays:Testing
Fixes #3074